package unit17.inetAddress;

import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressTest {
	public static void main(String[] args) throws UnknownHostException {
		if(args.length>0){
			String host=args[0];
			InetAddress[] addresses=InetAddress.getAllByName(host);
			for(InetAddress a:addresses)
				System.out.println(a);
		}else{
			InetAddress localhostAress=InetAddress.getLocalHost();
			System.out.println(localhostAress);
		}
			
	}
}
